package com.cxdr.awsips.analysis;

import org.apache.log4j.Logger;

import com.cxdr.awsips.analysis.config.SystemConfig;
import com.cxdr.awsips.analysis.logger.LogFactory;
import com.cxdr.awsips.analysis.processor.FileAnalysis;
import com.cxdr.awsips.analysis.processor.FileBakLogProccessor;
import com.cxdr.awsips.analysis.processor.FileScaner;
import com.cxdr.awsips.analysis.processor.WriteDBLogProccessor;

public class Start {
	private static Logger logger = LogFactory.makeNewLogger(Start.class);
	/**
	 * @param args
	 * @throws Exception 
	 */
	public static void main(String[] args) throws Exception {
		logger.info("*********************************");
		logger.info("开始解析系统服务器");
		logger.info("*********************************");
		Start start = new Start();
		start.start();
	}
	
	public void start() throws Exception{
		SystemConfig.load();
		//开启扫描线程
		FileScaner scaner = new FileScaner();
		scaner.start();
		//开启包文件入库线程(解析完后进行备份)
		FileAnalysis fpa = new FileAnalysis();
		fpa.start();
		//开启更正文件入库线程（解析完后进行备份）
	//	FileRegAnalysis fra = new FileRegAnalysis();
		//开启正常文件备份日志 入库日志记录并删除 线程
		WriteDBLogProccessor writeDBLogProccessor=new WriteDBLogProccessor();
		writeDBLogProccessor.start();
		//开启异常文件备份日志 线程
		FileBakLogProccessor fileBakLogProccessor=new FileBakLogProccessor();
		fileBakLogProccessor.start();
		
	
	}
}
